package com.example.demo.controller;

import com.example.demo.dao.VideoDao;
import com.example.demo.model.VideoEntity;
import com.example.demo.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class VideoController {
    @Autowired
    VideoDao videoDao;

    @PostMapping("/api/video")
    public String create(VideoEntity videoEntity) {
        videoEntity = videoDao.save(videoEntity);
        return Result.success(videoEntity);
    }

}
